home *** CD-ROM | disk | FTP | other *** search
/ Nebula 2 / Nebula Two.iso / SourceCode / MiscKit1.7.1 / MiscKit / Source / MiscInspectorKit / MiscInspector.m < prev    next >
Text File  |  1995-04-12  |  2KB  |  119 lines

  1. /* MiscInspector.m                 
  2.  *
  3.  * This class is a stupid single-attribute-inspector that is designed to work
  4.  * with the MiscInspectorManager and the MiscSwapView stuff.
  5.  *
  6.  * For more interface-info see the header file. In depth information
  7.  * can be found here in the source-code.
  8.  *
  9.  * Written by:         Thomas Engel
  10.  * Created:            08.02.1994 (Copyleft)
  11.  * Last modified:     08.02.1994
  12.  *
  13.  * Copyright (c) 1995 Thomas Engel
  14.  */
  15.  
  16. //#import "MiscInspector.h"
  17. //#import "MiscInspectorManager.h"
  18. #import <misckit/misckit.h>
  19.  
  20. @implementation MiscInspector
  21.  
  22. - (BOOL)doesHandleSelection
  23. {
  24.     // By default we will return YES here. In a real inspector class you should
  25.     // ask the manager for the selection type etc and decide then.
  26.     
  27.     return YES;
  28. }
  29.  
  30. - setManager:anObject
  31. {
  32.     return [self setManager:anObject registerSelf:YES];
  33. }
  34.  
  35. - setManager:anObject registerSelf:(BOOL)flag
  36. {
  37.     manager = anObject;
  38.     if( flag == YES ) [manager addInspector:self];
  39.     return self;
  40. }
  41.  
  42. - manager
  43. {
  44.     return manager;
  45. }
  46.  
  47. - ok:sender
  48. {
  49.     [[self window] setDocEdited:NO];
  50.     return self;
  51. }
  52.  
  53. - revert:sender
  54. {
  55.     // Here we will show/hide the buttons and set the editied state of the
  56.     // window.
  57.     // We also set the windows title to the title of the window of our view.
  58.     
  59.     [[self window] setTitle:[[view window] title]];
  60.  
  61.     if( [self wantsButtons] )
  62.             [manager setShowButtons:YES];
  63.     else    [manager setShowButtons:NO];
  64.     
  65.     [[self window] setDocEdited:NO];
  66.  
  67.     return self;
  68. }
  69.  
  70. - window
  71. {
  72.     return [manager window];
  73. }
  74.  
  75. - okButton
  76. {
  77.     return [manager okButton];
  78. }
  79.  
  80. - revertButton
  81. {
  82.     return [manager revertButton];
  83. }
  84.  
  85. - selection
  86. {
  87.     return [manager selection];
  88. }
  89.  
  90. - (unsigned)selectionCount
  91. {
  92.     return [manager selectionCount];
  93. }
  94.  
  95. - touch:sender
  96. {
  97.     [manager touch:sender];
  98.     return self;
  99. }
  100.  
  101. - textDidChange:sender
  102. {
  103.     [manager textDidChange:sender];
  104.     return self;
  105. }
  106.  
  107. - (BOOL)wantsButtons
  108. {
  109.     return YES;
  110. }
  111.  
  112. @end
  113.  
  114. /*
  115.  * History: 08.02.94 First code moved here.
  116.  *
  117.  *
  118.  * Bugs: - No read/write.
  119.  */